<template>
    <view class="webview-container">
        <web-view :src="webViewUrl"></web-view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            webViewUrl: ''
        }
    },
    onLoad(options) {
        if (options.url) {
            this.webViewUrl = decodeURIComponent(options.url);
            console.log(this.webViewUrl)
        } else {
            uni.showToast({
                title: '无效的链接', 
                icon: 'none',
                duration: 2000
            });
        }
    }
}
</script>

<style lang="scss">
.webview-container {
    width: 100%;
    height: 100%;
}
</style>
